function BSInspector()
{
    var myself = this;
    var options = arguments;
    var inspections = {};
    
    var myWindow = new BSWindow(document.body, {title: "bsInspector"});
    
    top[myWindow.getId() + "_intervalHandler"] = function()
    {
        return myself.inspect();
    }

    var outputDiv =  document.createElement('div');
    outputDiv.id = "bsOutputDiv" + myWindow.UID;
    
    
    with(outputDiv.style) {
        position   = "absolute";
        left       = "2px";
        top        = "22px";
        width      = "316px";
        height     = "276px";
        border     = "1px dotted black";
        fontFamily = "Arial,sans-serif";
        zIndex     = "1510";
        fontSize   = "9pt";
        backgroundColor = "#FFFFFF";
        color       = "#000000";
        overflow    = "auto";
    }
    myWindow.append(outputDiv);
    
    this.set = function(key, expression)
    {
        if(expression == undefined) {
            expression = key;
        }
        inspections[key] = expression;
        return true;
    }
    
    this.add = this.set;
    
    this.remove = function(key)
    {
        if(inspections[key]){
            inspections[key] == null;
            return true;
        }
        return false;
    }
    
    this.inspect = function()
    {
        var txt = "<table><tr><td>key&nbsp;&nbsp;&nbsp;</td><td>evaluated value</td></tr>";
        for (var key in inspections) {
            if (!Object.prototype[key]) {
                try {
                    txt += "<tr><td>" + key + "</td><td>" + eval(inspections[key]) + "</td></tr>";
                } catch(e) {
                    txt += "<tr><td>" + key + "</td><td>Exception thrown by " + inspections[key].slice(0,10) + "</td></tr>";
                }
            }
        }
        txt +="</table>";
        outputDiv.innerHTML = txt;
        return true;
    }
    
    this.loop = function()
    {s
        return window.setInterval(myWindow.getId() + "_intervalHandler()", (arguments[0] ? arguments[0] : 500));
    }

    this.show = function()
    {
        myWindow.show();
    }
    //window.setInterval(mainDiv.id + "_intervalHandler()", 250);
    //alert(mainDiv.id + "_intervalHandler");
    
    
}